思路:当然,首先想到的一定是 animation-play-state 这个属性有paused和running 两个值,那么利用这个东西,应该就能实现功能。
找原因:
所以我这边解决这个问题的思路是
$('.how-drap-btn').click(function(){
var self = this;
// 按钮隐藏,防止重复触发延时定时器
$(this).hide();
$('.petal').css('-webkit-animation-play-state','running')
$('.petal').css('animation-play-state','running')
setTimeout(function(){
$('.petal').css('-webkit-animation-play-state','paused')
$('.petal').css('animation-play-state','paused')
$(self).show();
},10000);
});